package com.park.common.bean;

import com.park.common.constant.IPlatformConstant;

public class ResponseBean<T> {
	
	private String code;
	private String message;
	private T data;
	
	public ResponseBean() {
		
	}

	public ResponseBean(T data) {
		this.code = IPlatformConstant.SUCCESS_CODE;
		this.message = IPlatformConstant.SUCCESS_MESSAGE;
		this.data = data;
	}
	
	public ResponseBean(boolean isSuccess) {
		this.code = isSuccess ? IPlatformConstant.SUCCESS_CODE : IPlatformConstant.FAIL_CODE;
		this.message = isSuccess ? IPlatformConstant.SUCCESS_MESSAGE : IPlatformConstant.FAIL_MESSAGE;
	}
	
	public ResponseBean(String message) {
		this.code = IPlatformConstant.FAIL_CODE;
		this.message = message;
	}
	
	public ResponseBean(String code, String message) {
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

}
